<?php
/* * 注意此文档为UTF-8的编码.
 * Created on 2010-5-29
 *
 * @author EXT <isrn@qq.com>
 *
 */
function getright($tid, $right) {
    global $_SESSION;
    if ($_SESSION['rcg'] == 'A') {
        return 1;
    } else {
        return $_SESSION['rcg'][$right][$tid];
    }
}
switch ($_SERVER['PHP_SELF']) {
    case Sf(HTLJ, $_SERVER['PHP_SELF']): {
            iniJs('ext');
            Tr($jsstr, 'showjs');
            if ($_SESSION['logined'] != '1') {
                $xajax = new xajax("./ajax/xajax_suo.php");
                $xajax->configure('javascript URI', Js_path . "/Plug-in/xajax/");
                $xajax->registerFunction("loadsuo");
                Tr(Sys::Gv(), 'site_config');
                $Tp->assign('ajax', $xajax->getJavascript());
                Ts('login' . $_SESSION['HTLG'] . '.html');
                exit;
            }
            if ($_SERVER['HTTP_REFERER'] == '' && !Sf('index.php', $_SERVER['PHP_SELF'])) {
//                if(($_GET['mid']==''||$_GET['from']!='b') && !Sf('treedata.php',$_SERVER['PHP_SELF'])) {
//                    Ja('非正确入口！');
                exit;
            }
            if ($_SESSION['rcg'] != 'A') {
                $tzurl = '/' . HTLJ . 'error.htm';
                if (Sf('show1/l.php', $_SERVER['PHP_SELF'])) {
                    if (!$_SESSION['rcg']['r'][$_REQUEST['tid']] && $_GET['op'] == 'list') {
                        Ja('没有浏览权限', $tzurl);
                        exit;
                    }
                }
                if (Sf('show1/i.php', $_SERVER['PHP_SELF'])) {
                    if ($_GET['op'] == 'add' && !$_GET['id'] && !$_SESSION['rcg']['c'][$_REQUEST['tid']]) {
                        //print_r($_SESSION['rcg']);
                        Ja('没有添加权限', $tzurl);
                        exit;
                    }
                }
                if (Sf('show1/i.php', $_SERVER['PHP_SELF'])) {
                    if ($_GET['op'] == 'add' && $_GET['id'] && !$_SESSION['rcg']['u'][$_REQUEST['tid']]) {
                        //print_r($_SESSION['rcg']);
                        Ja('没有更新权限', $tzurl);
                        exit;
                    }
                }
                if (Sf('show1/l.php', $_SERVER['PHP_SELF'])) {
                    if ($_REQUEST['op'] == 'del' && !$_SESSION['rcg']['d'][$_REQUEST['tid']]) {
                        //print_r($_SESSION['rcg']);
                        Ja('没有删除权限', $tzurl);
                        exit;
                    }
                }
            }
            break;
        }
}
?>